<?php
error_reporting(0);
//create swoole tcp client
$client = new swoole_client(SWOOLE_SOCK_TCP);
$client->connect('127.0.0.1', 9500, 10) or die("Connect Pool Failure !");

echo "输入要执行的 sql: ";
$sql = trim(fgets(STDIN));
//Send executing sql
$client->send($sql);
//Blocking for wait result
while(true)
{
    $data = $client->recv();
    echo($data."\n");
    if(strlen($data)==0) 
    {
        exit ;
    }
}

$client->close();